package com.mpsc.singleton.demo.service.impl;

import com.mpsc.singleton.demo.handler.BaseHandlerRequest;
import com.mpsc.singleton.demo.handler.async.AsyncManage;
import com.mpsc.singleton.demo.service.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AsyncServiceImpl implements AsyncService {

    @Autowired
    private AsyncManage asyncManage;

    @Override
    public void asyncTest() {
        BaseHandlerRequest request = new BaseHandlerRequest();
        //设置handler类型
        request.setType("TaskHandler");
        asyncManage.asyncExecute(request);
    }
}
